package com.shrcl.engineerprocess.domain.proxy;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.shrcl.engineerprocess.domain.proxy.EngineerCostEstimationAction;

public class EngineerCostEstimationManager implements IsSerializable {
  public static Boolean isActionValid(final EngineerCostEstimationAction action, final String state) {
    if(action==null||state==null) return false;
    switch(action){
    	case submit:{
    		return "created".equals(state);
    	}
    	case approve:{
    		return "estimating".equals(state);
    	}
    	case connectToCBD:{
    		return "approved".equals(state);
    	}
    	case CBDKickOff:{
    		return "CBDConnected".equals(state);
    	}
    	case engineerProjectKickOffNotify:{
    		return "CBDKickedOff".equals(state);
    	}
    	default:
    		return false;
    }
    
  }
  
  public static Boolean isActionValid(final EngineerCostEstimationAction action, final Enum<?> state) {
    return isActionValid(action,state.name());
    
  }
}
